#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>

void *fun(void *arg)
{
	int i = 0;

	for(i = 0;i < 5;i++)
	{
		printf("%ld:hello\n",pthread_self());
		sleep(1);
	}
}

int main()
{
	pthread_t tid = 0;
	int ret = 0;

	ret = pthread_create(&tid,NULL,fun,NULL);
	if(ret != 0)
	{
		printf("pthread_create error\n");
		exit(-1);
	}

	ret = pthread_create(&tid,NULL,fun,NULL);
	if(ret != 0)
	{
		printf("pthread_create error\n");
		exit(-1);
	}
	
	for(int i = 0;i < 5;i++)
	{
		printf("world\n");
		sleep(1);
	}



	return 0;
}
